/**
* \brief 
* \author pengcheng (pengcheng@yslrpch@126.com)
* \date 
* \attention CopyrightÃ‚Â©ADC Technology(tianjin)Co.Ltd
* \attention Refer to COPYRIGHT.txt for complete terms of copyright notice
*/

#ifndef SGM_WINNER_TAKES_ALL_HPP
#define SGM_WINNER_TAKES_ALL_HPP

#include <stereo_vision/sgm.h>
#include "stereo_vision/impl/device_buffer.hpp"
#include "stereo_vision/impl/types.hpp"

namespace adc {

template <size_t MAX_DISPARITY>
class WinnerTakesAll {

private:
	DeviceBuffer<output_type> m_left_buffer;
	DeviceBuffer<output_type> m_right_buffer;

public:
	WinnerTakesAll();

	const output_type *get_left_output() const {
		return m_left_buffer.data();
	}

	const output_type *get_right_output() const {
		return m_right_buffer.data();
	}

	void enqueue(
		const cost_type *src,
		int width,
		int height,
		int pitch,
		float uniqueness,
		bool subpixel,
		PathType path_type,
		cudaStream_t stream);

	void enqueue(
		output_type *left,
		output_type *right,
		const cost_type *src,
		int width,
		int height,
		int pitch,
		float uniqueness,
		bool subpixel,
		PathType path_type,
		cudaStream_t stream);

};

}

#endif
